package com.fruit.audit.bean;

import java.sql.Timestamp;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.map.annotate.JsonSerialize;

/**
 * 用户信息表
 * @author jinghao.liang
 *
 */
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class TutorUser {
	/**
	 * 主键 非空
	 */
	private Long id;
	/**
	 * 昵称 （教师必填）
	 */
	private String name;
	/**
	 * 手机号 非空
	 */
	private String phone;
	/**
	 * 邮箱 非空
	 */
	private String email;
	/**
	 * 32位md5加密密码 非空
	 */
	private String password;
	/**
	 * 0:老师, 1:学生 非空
	 */
	private Integer role;
	/**
	 * 0:正常,-1:删除 非空 默认0
	 */
	private Integer status;
	/**
	 * 创建时间 非空 默认系统时间
	 */
	private Timestamp createTime;
	/**
	 * 最后登陆时间 非空 默认系统时间
	 */
	private Timestamp loginTime;
	/**
	 * 经度
	 */
	private Float x;
	/**
	 * 纬度
	 */
	private Float y;
	/**
	 * 设备信息
	 */
	private String deviceInfo;
	/**
	 * token
	 */
	private String token;
	public TutorUser() {
	}
	public TutorUser(TutorUser user) {
		this.createTime = user.createTime;
		this.email = user.email;
		this.id = user.id;
		this.loginTime = user.loginTime;
		this.name = user.name;
		this.password = user.password;
		this.phone = user.phone;
		this.role = user.role;
		this.status = user.status;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	@JsonIgnore
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@JsonIgnore
	public Integer getRole() {
		return role;
	}
	public void setRole(Integer role) {
		this.role = role;
	}
	@JsonIgnore
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@JsonIgnore
	public Timestamp getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	public void setCreateTime(long currentTimeMillis) {
		this.createTime = new Timestamp(currentTimeMillis);
	}
	public Timestamp getLoginTime() {
		return loginTime;
	}
	public void setLoginTime(Timestamp loginTime) {
		this.loginTime = loginTime;
	}
	@JsonIgnore
	public Float getX() {
		return x;
	}
	public void setX(Float x) {
		this.x = x;
	}
	@JsonIgnore
	public Float getY() {
		return y;
	}
	public void setY(Float y) {
		this.y = y;
	}
	@JsonIgnore
	public String getDeviceInfo() {
		return deviceInfo;
	}
	public void setDeviceInfo(String deviceInfo) {
		this.deviceInfo = deviceInfo;
	}
	public String getToken() {
		return token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	@Override
	public String toString() {
		return "TutorUser [id=" + id + ", name=" + name + ", phone=" + phone
				+ ", email=" + email + ", password=" + password + ", role="
				+ role + ", status=" + status + ", createTime=" + createTime
				+ ", loginTime=" + loginTime + ", x=" + x + ", y=" + y
				+ ", deviceInfo=" + deviceInfo + ", token=" + token + "]";
	}
	
	
}
